﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.postgresql
{
	// Token: 0x02000129 RID: 297
	public class TPlsqlCreateTriggerSqlStatement : TCustomSqlStatement
	{
		// Token: 0x0600097C RID: 2428 RVA: 0x00303639 File Offset: 0x00301839
		public TPlsqlCreateTriggerSqlStatement(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstpostgresqlCreateTrigger;
		}

		// Token: 0x170001A7 RID: 423
		// (get) Token: 0x0600097D RID: 2429 RVA: 0x0030364D File Offset: 0x0030184D
		// (set) Token: 0x0600097E RID: 2430 RVA: 0x00303655 File Offset: 0x00301855
		public virtual TFunctionCall FunctionCall
		{
			get
			{
				return this.functionCall;
			}
			set
			{
				this.functionCall = value;
			}
		}

		// Token: 0x170001A8 RID: 424
		// (get) Token: 0x0600097F RID: 2431 RVA: 0x0030365E File Offset: 0x0030185E
		// (set) Token: 0x06000980 RID: 2432 RVA: 0x00303666 File Offset: 0x00301866
		public virtual TTable OnTable
		{
			get
			{
				return this.onTable;
			}
			set
			{
				this.onTable = value;
			}
		}

		// Token: 0x170001A9 RID: 425
		// (get) Token: 0x06000981 RID: 2433 RVA: 0x0030366F File Offset: 0x0030186F
		// (set) Token: 0x06000982 RID: 2434 RVA: 0x00303677 File Offset: 0x00301877
		public virtual TObjectName TriggerName
		{
			get
			{
				return this.triggerName;
			}
			set
			{
				this.triggerName = value;
			}
		}

		// Token: 0x06000983 RID: 2435 RVA: 0x00303680 File Offset: 0x00301880
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TCreateTriggerSqlNode tcreateTriggerSqlNode = (TCreateTriggerSqlNode)this.rootNode;
			this.triggerName = tcreateTriggerSqlNode.TriggerName;
			base.DatabaseObjects.Add(this.triggerName);
			this.onTable = tcreateTriggerSqlNode.OnTable;
			this.functionCall = tcreateTriggerSqlNode.FunctionCall;
			return 0;
		}

		// Token: 0x06000984 RID: 2436 RVA: 0x003036E1 File Offset: 0x003018E1
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000985 RID: 2437 RVA: 0x003036F1 File Offset: 0x003018F1
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x04001247 RID: 4679
		private TObjectName triggerName;

		// Token: 0x04001248 RID: 4680
		private TTable onTable;

		// Token: 0x04001249 RID: 4681
		private TFunctionCall functionCall;
	}
}
